const mongoose = require('mongoose');
//  数据连接开启的方法
function dbConnect() {
    mongoose.connect("mongodb://127.0.0.1/shoppingonline");
    mongoose.connection.once('open',function (err) {
        if(err){
            console.log("MongoDb cannot open!");
        }else {
            console.log("MongoDb is opening!");
        }
    })
}
exports.dbConnect = dbConnect;